import { RouteRecordRaw } from 'vue-router'


/*
 * 静态路由
 */
const staticRoutes: Array<RouteRecordRaw> = [
    {
        // 管理员登录页
        path: '/system/login',
        name: 'systemLogin',
        component: () => import('/@/views/system/login.vue'),
        meta: {
            title:"登录",
        },
    },
    {
        path: '/:path(.*)*',
        redirect: '/404',
    },
    {
        path: '/404',
        name: 'notFound',
        component: () => import('/@/views/common/error/404.vue'),
        meta: {
            title: "页面不存在", //
        },
    },
    {
        path: '/401',
        name: 'noPower',
        component: () => import('/@/views/common/error/401.vue'),
        meta: {
            title: "无权限访问",
        },
    },
] as Array<RouteRecordRaw>

/*
 * 后台基础静态路由
 */
const adminBaseRoute: RouteRecordRaw = {
    path: '/admin',
    name: 'admin',
    component: () => import('/@/layouts/backend/index.vue'),
    redirect: '/admin/loading',
    meta: {
        title: "admin",
    },
    children: [
        {
            path: 'loading/:to?',
            name: 'adminMainLoading',
            component: () => import('/@/layouts/common/components/loading.vue'),
            meta: {
                title: "正在加载",
            },
        },
    ],
} as RouteRecordRaw

staticRoutes.push(adminBaseRoute)
export { staticRoutes, adminBaseRoute }
